﻿<Activity mc:Ignorable="sap sap2010 sads" x:Class="artiso.TFSEventWorkflows.WorkflowsLib.AddTaskToNewUserStory"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:att="clr-namespace:artiso.TFSEventWorkflows.TFSActivitiesLib;assembly=artiso.TFSEventWorkflows.TFSActivitiesLib"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mtfs="clr-namespace:Microsoft.TeamFoundation.Framework.Server;assembly=Microsoft.TeamFoundation.Framework.Server"
 xmlns:mtwc="clr-namespace:Microsoft.TeamFoundation.WorkItemTracking.Client;assembly=Microsoft.TeamFoundation.WorkItemTracking.Client"
 xmlns:mtws="clr-namespace:Microsoft.TeamFoundation.WorkItemTracking.Server;assembly=Microsoft.TeamFoundation.WorkItemTracking.Server"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="TFSEvent" Type="InArgument(mtws:WorkItemChangedEvent)" />
    <x:Property Name="TeamFoundationRequestContext" Type="InArgument(mtfs:IVssRequestContext)" />
  </x:Members>
  <mva:VisualBasic.Settings>
    <x:Null />
  </mva:VisualBasic.Settings>
  <sap2010:WorkflowViewState.IdRef>artiso.TFSEventWorkflows.WorkflowsLib.AddTaskToNewUserStory_1</sap2010:WorkflowViewState.IdRef>
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System.Activities</x:String>
      <x:String>System.Activities.XamlIntegration</x:String>
      <x:String>System.Activities.Statements</x:String>
      <x:String>System.Activities.Expressions</x:String>
      <x:String>System.Activities.Validation</x:String>
      <x:String>artiso.TFSEventWorkflows.TFSActivitiesLib</x:String>
      <x:String>Microsoft.TeamFoundation.Framework.Server</x:String>
      <x:String>Microsoft.TeamFoundation.WorkItemTracking.Client</x:String>
      <x:String>Microsoft.TeamFoundation.WorkItemTracking.Server</x:String>
      <x:String>Microsoft.VisualBasic.Activities</x:String>
      <x:String>System.Activities.Debugger</x:String>
      <x:String>System.Activities.Debugger.Symbol</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Windows.Markup</x:String>
      <x:String>System</x:String>
      <x:String>Microsoft.TeamFoundation.WorkItemTracking.Common</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>artiso.TFSEventWorkflows.TFSActivitiesLib</AssemblyReference>
      <AssemblyReference>Microsoft.TeamFoundation.Framework.Server</AssemblyReference>
      <AssemblyReference>Microsoft.TeamFoundation.WorkItemTracking.Client</AssemblyReference>
      <AssemblyReference>Microsoft.TeamFoundation.WorkItemTracking.Server</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>PresentationFramework</AssemblyReference>
      <AssemblyReference>WindowsBase</AssemblyReference>
      <AssemblyReference>PresentationCore</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.ServiceModel</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <Sequence DisplayName="Main" sap2010:WorkflowViewState.IdRef="Sequence_2">
    <Sequence.Variables>
      <Variable x:TypeArguments="mtwc:WorkItem" Name="SavedWorkitem" />
      <Variable x:TypeArguments="x:String" Name="TFSUrl" />
      <Variable x:TypeArguments="mtwc:WorkItem" Name="NewWorkItem" />
    </Sequence.Variables>
    <If Condition="[TFSEvent.ChangeType = ChangeTypes.New]" DisplayName="If IsNew" sap2010:WorkflowViewState.IdRef="If_2">
      <If.Then>
        <Sequence DisplayName="for new workitems" sap2010:WorkflowViewState.IdRef="Sequence_3">
          <att:GetWorkItemChangedEventData ChangedFields="{x:Null}" sap2010:WorkflowViewState.IdRef="GetWorkItemChangedEventData_1" TFSCollectionUrl="[TFSUrl]" TeamFoundationRequestContext="[TeamFoundationRequestContext]" WorkItem="[SavedWorkitem]" WorkItemChangedEvent="[TFSEvent]" />
          <If Condition="[SavedWorkitem.Type.Name.Equals(&quot;User Story&quot;) Or SavedWorkitem.Type.Name.Equals(&quot;Product Backlog Item&quot;)]" DisplayName="If &quot;User Story&quot; or &quot;Product Backlog Item&quot;" sap2010:WorkflowViewState.IdRef="If_1">
            <If.Then>
              <Sequence DisplayName="create &quot;Task for &quot;User Story&quot;" sap2010:WorkflowViewState.IdRef="Sequence_1">
                <att:CreateNewWorkItem sap2010:WorkflowViewState.IdRef="CreateNewWorkItem_1" NewWorkItem="[NewWorkItem]" TFSCollectionUrl="[TFSUrl]" TeamProjectName="[SavedWorkitem.Project.Name]" WorkItemType="Task" />
                <att:ChangeWorkItemField FieldReferenceName="System.Title" sap2010:WorkflowViewState.IdRef="ChangeWorkItemField_1" NewValue="[String.Format(&quot;Task for User Story ({0}) {1} &quot;, SavedWorkitem.Id, SavedWorkitem.Title)]" WorkItem="[NewWorkItem]" />
                <att:SaveWorkItem sap2010:WorkflowViewState.IdRef="SaveWorkItem_1" WorkItem="[NewWorkItem]" />
                <att:CreateLink ChildWorkItem="[NewWorkItem]" sap2010:WorkflowViewState.IdRef="CreateLink_1" LinkType="System.LinkTypes.Hierarchy" ParentWorkItem="[SavedWorkitem]" />
              </Sequence>
            </If.Then>
          </If>
        </Sequence>
      </If.Then>
    </If>
    <sads:DebugSymbol.Symbol>d15DOlxXU1xDb2RlcGxleFx0ZnNldmVudHdvcmtmbG93c1xURlNFdmVudFdvcmtmbG93czIwMTJcV29ya2Zsb3dzTGliXEFkZFRhc2tUb05ld1VzZXJTdG9yeS54YW1sGzwDVA4CAQFCBVIKAgECQhNCPAIBA0QJUBQCAQRFC0WeAgIBHUYLTxACAQVFjwJFmwICASRF6AFF+QECASJFvgFF3gECASBFlgFFoAECAR5GGUaXAQIBBkgPTRoCAQdJEUnbAQIBFkoRSo0CAgERSxFLbwIBDkwRTLcBAgEISaYBScQBAgEcSdIBSdgBAgEbSWpJeQIBGUmLAUmVAQIBF0r7AUqKAgIBFEqNAUrxAQIBE0o9SksCARJLXUtsAgEPTC9MPgIBDEx3TJMBAgELTKMBTLQBAgEJ</sads:DebugSymbol.Symbol>
  </Sequence>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="GetWorkItemChangedEventData_1" sap:VirtualizedContainerService.HintSize="464,22" />
      <sap2010:ViewStateData Id="CreateNewWorkItem_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="ChangeWorkItemField_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="SaveWorkItem_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="CreateLink_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="222,332">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="If_1" sap:VirtualizedContainerService.HintSize="464,480" />
      <sap2010:ViewStateData Id="Sequence_3" sap:VirtualizedContainerService.HintSize="486,666">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="If_2" sap:VirtualizedContainerService.HintSize="611,814" />
      <sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="633,938">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="artiso.TFSEventWorkflows.WorkflowsLib.AddTaskToNewUserStory_1" sap:VirtualizedContainerService.HintSize="673,1018" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>